package jp.dodododo.dao.object;

import java.util.Map;

import jp.dodododo.dao.util.CacheUtil;

public class ObjectDescFactory {

	private static Map<Class<?>, ObjectDesc> objectDescCache = CacheUtil.cacheMap();

	public static ObjectDesc getObjectDesc(Object o) {
		return getObjectDesc(o.getClass());
	}

	public static ObjectDesc getObjectDesc(Class<?> clazz) {
		ObjectDesc objectDesc = objectDescCache.get(clazz);
		if (objectDesc == null) {
			objectDesc = new ObjectDesc(clazz);
			objectDescCache.put(clazz, objectDesc);
		}
		return objectDesc;
	}

}
